package com.cby.jetpack.common.widget.snackbar

import android.view.View
import com.cby.jetpack.common.widget.snackbar.ColoredSnackbar.alert
import com.cby.jetpack.common.widget.snackbar.ColoredSnackbar.confirm
import com.cby.jetpack.common.widget.snackbar.ColoredSnackbar.defaultInfo
import com.cby.jetpack.common.widget.snackbar.ColoredSnackbar.info
import com.cby.jetpack.common.widget.snackbar.ColoredSnackbar.warning
import com.google.android.material.snackbar.Snackbar

/**
 * Created by maning on 16/1/18.
 *
 *
 * 提示框
 */
object MySnackbar {
    fun makeSnackBarBlack(view: View?, message: String?) {
        val snackbar = Snackbar.make(
            view!!, message!!, Snackbar.LENGTH_SHORT
        )
        defaultInfo(snackbar).show()
    }

    fun makeSnackBarRed(view: View?, message: String?) {
        val snackbar = Snackbar.make(
            view!!, message!!, Snackbar.LENGTH_LONG
        )
        alert(snackbar).show()
    }

    fun makeSnackBarBlue(view: View?, message: String?) {
        val snackbar = Snackbar.make(
            view!!, message!!, Snackbar.LENGTH_SHORT
        )
        info(snackbar).show()
    }

    fun makeSnackBarOrange(view: View?, message: String?) {
        val snackbar = Snackbar.make(
            view!!, message!!, Snackbar.LENGTH_LONG
        )
        warning(snackbar).show()
    }

    fun makeSnackBarGreen(view: View?, message: String?) {
        val snackbar = Snackbar.make(
            view!!, message!!, Snackbar.LENGTH_LONG
        )
        confirm(snackbar).show()
    }
}